<?php

function checkAuth($area, $url)
{
    if ($area && $url->getParam("mod") == "account" && ( $url->getParam("act") == "login" || $url->getParam("act") == "do_login"))
        return;
    if ($area == "admin" && !isset($_SESSION[$area]['id'])){
	    Core::req()->forward("/admin/login");
    }

    /*if ($area != "visitor" && !isset($_SESSION[$area]['id'])) {
	    Core::req()->forward("/");	    
	}	 */
}

_addEvent("PROCESS_START", "checkAuth");
?>